import request from '@/utils/request'

export function save(data) {
    if(data.id ==null){
        return request({
            url: '/coupons/',
            method: 'post',
            data:data
        })
    }else{
        return request({
            url: '/coupons/'+data.id,
            method: 'put',
            data:data
        })
    }

}


export function findList(params) {
    return request({
        url: '/coupons',
        method: 'get',
        params:params
    })
}
export function changeStatus(id,status) {
    return request({
        url: '/coupons/changeStatus/'+id,
        method: 'put',
        params:{status:status}
    })
}
export function findDetail(id) {
    return request({
        url: '/coupons/'+id,
        method: 'get'
    })
}
export function deleted(id) {
    return request({
        url: '/coupons/'+id,
        method: 'delete'
    })
}
